package com.demo.Aspect;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Service;

import java.util.Arrays;

@Service
@Aspect
@Order(1)
public class Aspect2 {
    @Pointcut("execution(private * com.demo.Aspect.*.*(..))")
    public void handleException(){}

    @Around("handleException()")
    public Object aroundCut(ProceedingJoinPoint proceedingJoinPoint ) {
        System.out.println("22222222222222");
        proceedingJoinPoint.getTarget();
        try {
            proceedingJoinPoint.proceed();
        } catch (Throwable e) {
            e.printStackTrace();
        }
        return "ok";
    }
}
